﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WorldSimulator.PhysicsEngine
{
	public interface IPhysicsEngine : IDisposable
	{
		/// <summary>
		/// Registers the objects for physics calculation
		/// </summary>
		/// <param name="objects">Objects to register</param>
		void RegisterObjects(IEnumerable<IPhysicalObject> objects);

		/// <summary>
		/// Unregisters the objects for physics calculation
		/// </summary>
		/// <param name="objects">Objects to unregister</param>
		void UnregisterObjects(IEnumerable<IPhysicalObject> objects);

		/// <summary>
		/// Registers an object for physics calculation
		/// </summary>
		/// <param name="obj">Physical object</param>
		void RegisterObject(IPhysicalObject obj);

		/// <summary>
		/// Unregisters an object for physics calculation
		/// </summary>
		/// <param name="obj">Physical object</param>
		void UnregisterObject(IPhysicalObject obj);

		/// <summary>
		/// Calculates the physically acting forces and applies them to the momentum of the objects
		/// </summary>
		/// <param name="timeDeltaInSeconds">timeDelta in seconds</param>
		void ApplyPhysics(double timeDeltaInSeconds);

		/// <summary>
		/// Moves the objects based on the currently acting forces
		/// </summary>
		/// <param name="timeDeltaInSeconds">timeDelta in seconds</param>
		void MoveObjects(double timeDeltaInSeconds);
	}
}
